/***********************************************************************************************************************************
 * Name:	Check_xp_configure.sql
 * Author:	Frank Figearo (frank.figearo@us.bbaaviation.com|frank@sqlnerd.me)
 * Summary:	Flag the setting of a particular configuration item.
 */
SET IMPLICIT_TRANSACTIONS OFF; WHILE 0 < @@TRANCOUNT ROLLBACK;
GO
SET NOCOUNT ON;
DECLARE @xp_configure TABLE (
	name			NVARCHAR(35)	NOT Null,
	minimum			INT				NOT Null,
	maximum			INT				NOT Null,
	config_value	INT				NOT Null,
	run_value		INT				NOT Null);
INSERT INTO @xp_configure EXECUTE sp_configure;
IF EXISTS (SELECT * FROM @xp_configure WHERE name = 'xp_cmdshell' AND (config_value = 1 OR run_value = 1)) PRINT @@SERVERNAME;
SET NOCOUNT OFF;
GO